﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace Javavaj.iHunter.Core
{
    /// <summary>
    /// 插件的类型
    /// </summary>
    public enum PluginType
    {
        Unknown = 0,
        /// <summary>
        /// 频道生成器
        /// </summary>
        ChannelPlugin,
        /// <summary>
        /// 过滤器
        /// </summary>
        FilterPlugin,
        /// <summary>
        /// 文档查看器
        /// </summary>
        ViewerPlugin
    };

    /// <summary>
    /// 表示插件的基本信息
    /// </summary>
    public struct PluginInformation : IEquatable<PluginInformation>
    {
        /// <summary>
        /// 插件的类型
        /// </summary>
        public PluginType PluginType { get; set; }
        /// <summary>
        /// 插件名称
        /// </summary>

        public string Name { get; set; }
        /// <summary>
        /// 插件版本
        /// </summary>
        public string Version { get; set; }
        /// <summary>
        /// 插件是否被启用
        /// </summary>
        public bool Enabled { get; set; }
        /// <summary>
        /// 是否为全局插件
        /// </summary>
        public bool Global { get; set; }

        /// <summary>
        /// 插件程序集的显示名称
        /// </summary>
        public string Assembly { get; set; }

        public string FullPath { get; set; }

        public override bool Equals(object obj)
        {
            if (obj.GetType() != typeof(PluginInformation))
                return false;
            return (this.Equals((PluginInformation)obj));
        }
        public override int GetHashCode()
        {
            return Assembly.GetHashCode();
        }



        #region IEquatable<PluginInformation> 成员

        public bool Equals(PluginInformation other)
        {
            return (Assembly == other.Assembly);
                
        }

        #endregion
    }

}
